<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/apps/smtp/smtp.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('smtp_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">smtp.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;lwip/apps/smtp.h&quot;</code><br />
<code>#include &quot;<a class="el" href="sys_8h.html">lwip/sys.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="sockets_8h.html">lwip/sockets.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="altcp_8h.html">lwip/altcp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="dns_8h.html">lwip/dns.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h.html">lwip/mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="altcp__tcp_8h.html">lwip/altcp_tcp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="altcp__tls_8h.html">lwip/altcp_tls.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsmtp__session.html">smtp_session</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a19ebd0b9a82b87fd205fed0dba06649e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a>&#160;&#160;&#160;4</td></tr>
<tr class="separator:a19ebd0b9a82b87fd205fed0dba06649e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad853ab316a3b866b87c0454053febfe3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="smtp_8c.html#ad853ab316a3b866b87c0454053febfe3">SMTP_TIMEOUT_DATABLOCK</a>&#160;&#160;&#160;( 3 * 60 * <a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a> / 2)</td></tr>
<tr class="separator:ad853ab316a3b866b87c0454053febfe3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73855e673457f748b6bcba49aab9b035"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="smtp_8c.html#a73855e673457f748b6bcba49aab9b035">SMTP_TIMEOUT_DATATERM</a>&#160;&#160;&#160;(10 * 60 * <a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a> / 2)</td></tr>
<tr class="separator:a73855e673457f748b6bcba49aab9b035"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6029851c4f71d98b00d6c49a17ea9ef6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="smtp_8c.html#a6029851c4f71d98b00d6c49a17ea9ef6">SMTP_TIMEOUT</a>&#160;&#160;&#160;( 2 * 60 * <a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a> / 2)</td></tr>
<tr class="separator:a6029851c4f71d98b00d6c49a17ea9ef6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a04947fff2d3a3803e6c716aecc7f2bae"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="smtp_8c.html#a04947fff2d3a3803e6c716aecc7f2bae">smtp_session_state</a> </td></tr>
<tr class="separator:a04947fff2d3a3803e6c716aecc7f2bae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga1ccf4305461ec16cf41599341ec54983"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#ga1ccf4305461ec16cf41599341ec54983">smtp_set_server_addr</a> (const char *server)</td></tr>
<tr class="separator:ga1ccf4305461ec16cf41599341ec54983"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4b0606e7ad64d8215cebbea43f08759f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#ga4b0606e7ad64d8215cebbea43f08759f">smtp_set_server_port</a> (u16_t port)</td></tr>
<tr class="separator:ga4b0606e7ad64d8215cebbea43f08759f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae72a8a0ec42ecae1be401978e224c39e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#gae72a8a0ec42ecae1be401978e224c39e">smtp_set_tls_config</a> (struct altcp_tls_config *tls_config)</td></tr>
<tr class="separator:gae72a8a0ec42ecae1be401978e224c39e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga79567a5a75e048a6b8addb5b038fc899"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#ga79567a5a75e048a6b8addb5b038fc899">smtp_set_auth</a> (const char *username, const char *pass)</td></tr>
<tr class="separator:ga79567a5a75e048a6b8addb5b038fc899"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae43119480c4146df9eeff7ae80c767f7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#gae43119480c4146df9eeff7ae80c767f7">smtp_send_mail</a> (const char *from, const char *to, const char *subject, const char *body, smtp_result_fn callback_fn, void *callback_arg)</td></tr>
<tr class="separator:gae43119480c4146df9eeff7ae80c767f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06f6582701def2a62582373bb0be5788"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#ga06f6582701def2a62582373bb0be5788">smtp_send_mail_static</a> (const char *from, const char *to, const char *subject, const char *body, smtp_result_fn callback_fn, void *callback_arg)</td></tr>
<tr class="separator:ga06f6582701def2a62582373bb0be5788"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa9331cc8c6d73a8cd7e6e4466aca9243"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__smtp.html#gaa9331cc8c6d73a8cd7e6e4466aca9243">smtp_send_mail_int</a> (void *arg)</td></tr>
<tr class="separator:gaa9331cc8c6d73a8cd7e6e4466aca9243"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>SMTP client module</p>
<p>Author: Simon Goldschmidt </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a19ebd0b9a82b87fd205fed0dba06649e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19ebd0b9a82b87fd205fed0dba06649e">&#9670;&nbsp;</a></span>SMTP_POLL_INTERVAL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SMTP_POLL_INTERVAL&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>TCP poll interval. Unit is 0.5 sec. </p>

</div>
</div>
<a id="a6029851c4f71d98b00d6c49a17ea9ef6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6029851c4f71d98b00d6c49a17ea9ef6">&#9670;&nbsp;</a></span>SMTP_TIMEOUT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SMTP_TIMEOUT&#160;&#160;&#160;( 2 * 60 * <a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a> / 2)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>TCP poll timeout while not sending the body. This is somewhat lower than the RFC states (5 minutes for initial, MAIL and RCPT) but still OK for us here. 2 minutes </p>

</div>
</div>
<a id="ad853ab316a3b866b87c0454053febfe3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad853ab316a3b866b87c0454053febfe3">&#9670;&nbsp;</a></span>SMTP_TIMEOUT_DATABLOCK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SMTP_TIMEOUT_DATABLOCK&#160;&#160;&#160;( 3 * 60 * <a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a> / 2)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>TCP poll timeout while sending message body, reset after every successful write. 3 minutes </p>

</div>
</div>
<a id="a73855e673457f748b6bcba49aab9b035"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73855e673457f748b6bcba49aab9b035">&#9670;&nbsp;</a></span>SMTP_TIMEOUT_DATATERM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SMTP_TIMEOUT_DATATERM&#160;&#160;&#160;(10 * 60 * <a class="el" href="smtp_8c.html#a19ebd0b9a82b87fd205fed0dba06649e">SMTP_POLL_INTERVAL</a> / 2)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>TCP poll timeout while waiting for confirmation after sending the body. 10 minutes </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a04947fff2d3a3803e6c716aecc7f2bae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04947fff2d3a3803e6c716aecc7f2bae">&#9670;&nbsp;</a></span>smtp_session_state</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="smtp_8c.html#a04947fff2d3a3803e6c716aecc7f2bae">smtp_session_state</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>State for SMTP client state machine </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_53adf0b982dc8545998aae3f283a5a58.html">apps</a></li><li class="navelem"><a class="el" href="dir_149963277126306875d8bfe8322084f3.html">smtp</a></li><li class="navelem"><a class="el" href="smtp_8c.html">smtp.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
